package 力扣.链表;

public class 删除排序链表中的重复元素83 {
    public ListNode deleteDuplicates(ListNode head) {
          ListNode dummy = new ListNode();
          dummy.next = head;
          ListNode last = dummy;
          while (head != null){
              while ( (null != head.next) && (head.val == head.next.val)){
                  last.next = head.next;
                  head = head.next;
              }
              last = head;
              head = head.next;
          }
          return dummy.next;
    }
}
